Interrupt 21h Function 440Dh Minor Code 6Ch 

Polls the state of the access flag on a volume to determine if a write operation (for example, deleting or renaming a file or writing to a file) or a new file mapping has occurred since the last poll.

mov ax, 440Dh        ; generic IOCTL

mov bl, DriveNum     ; see below

mov ch, 08h          ; device category (must be 08h)

mov cl, 6Ch          ; Get Lock Flag State

int 21h

 

jc error

mov [AccessFlag], ax  ; state of access flag

 

Parameters

DriveNum

Drive to poll. This parameter can be 0 for the default drive, 1 for A, 2 for B, and so on.

 

Return Value

Clears the carry flag and sets the AX register to one of the following values if successful:

0

No write operations or file mappings have occurred since the last poll.

1

A write operation has occurred since the last poll (clears the volume access flag).

2

A file mapping has occurred since the last poll, or a 32-bit Windows-based DLL or executable has been opened (clears the volume access flag).

 

Otherwise, the function sets the carry flag and sets the AX register to an error value.

Remarks

Only the current lock owner may poll the access flag. The system fails other processes with ERROR_ACCESS_DENIED error value. Write operations performed by the lock owner do not cause a change in the state of the access flag.

When a lock is obtained that allows write operations or new file mappings, the system sets a flag whenever one of these operations happens on the volume. If a write operation or new file mapping has occurred since the last poll, Get Lock Flag State returns 1 or 2 respectively in the AX register and clears the volume access flag. If the swap file has grown or shrunk since the last poll, Get Lock Flag State returns 1. Note that write operations to the swap file that do not cause a change in size do not cause a change in the state of the access flag. If a 32-bit Windows-based DLL or executable has been opened since the last poll, Get Lock Flag State returns 2.